/*
 * Location.cpp
 *
 *  Created on: Jul 1, 2009
 *      Author: kurt
 */

#include "Location.h"
#include <iostream>
#include <sstream>
using namespace std;
using namespace objdraw;

Location::~Location() { }
Location::Location() 
{ 
	x = y = 0; 
}
Location::Location(float _x, float _y) 
{ 
	x = _x; y = _y; 
}
float Location::distanceTo(Location point)
{
//	TODO calculate distance
	return 0;
}
float Location::getX() { return x; }
float Location::getY() { return y; }
void Location::setX(float _x) { x = _x; }
void Location::setY(float _y) { y = _y; }
void Location::translate(float _x, float _y) { x += _x; y += _y; }
void Location::moveTo(float _x, float _y) { x = _x; y = _y; }
string Location::toString()
{
	stringstream rstr("Location: ");
	rstr << "x = " << x <<
	"; y = " << y << ";";
	return rstr.str();
}

bool Location::operator ==(Location & point)
{
	if(point.getX() == x && point.getY() == y) 
		return true;
	return false;
}
